home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
tekemul.arc
/
TEKEMUL.DOC
< prev
Wrap
Text File
|
1984-09-19
|
17KB
|
442 lines
1
:
$**$ MARGIN=.6
RUNNING MTS GRAPHICS PROGRAMS ON THE IBM PC
1. Introduction
This document describes how graphics programs (e.g. *PLOTSEE)
that produce graphics on a TEKTRONIX 4010 series terminal may be
run on an IBM PC with output on an attached graphics monitor. This
is achieved by use of TEKTRONIX 4010 terminal emulation software
(TEKEMUL) running on the PC. This program communicates with MTS
and causes the TEKTRONIX ASCII codes from MTS to be interpreted
and displayed on the monitor. Thus a user needs a graphics monitor
in order to use the system. TEKEMUL is written in complied BASIC.
The structured nature (as much as BASIC permits) of the program is
intended to allow it to be adapted to other micro-computers in the
future.
2. Using TEKEMUL to Output MTS Graphics on the PC
Here we assume that the user has some familiarity with
operating the IBM PC. The emulation program displays graphical
information in the high resolution mode of the computer. Thus the
IBM colour/graphics monitor card and a graphics monitor must be
attached to the IBM PC in order that the facility can work as
intended.
Upon inserting the disk containing TEKEMUL into the disk drive
one merely types in "TEKEMUL". This command loads and begins
executing the emulator program.
The program is of an interactive nature making it quite easy to
use. The following describes the use of the TEKEMUL program:
a) A general instruction menu is displayed. This explains some
of the operational details on how the program is to be used.
Pressing any key allows one to continue on.
b) A communication set-up menu is then displayed. The default
parameter values for baud rate, parity, data size, and number
of stop bits is displayed in bold face. It is up to the user to
ensure that the communication parameters are correct before
continuing. For example, he should insure that the baud rate
given to the program is the same as the baud rate of the line
that communicates with MTS.
Changing the communication parameters is a simple matter of
entering the new value of the parameter in place of the old
value. If all of the parameters are correct the user enters a
"Y" to indicate that the parameters displayed are correct. The
message "Time to flick your data set now..." is displayed
momentarily and then the screen is cleared. It is at this point
that the user initiates the connection with MTS.
1
c) The standard MTS header should be displayed at this time.
When prompted for terminal-id, you should respond with "T4010".
This signifies to MTS that you have a Tektronix 4010 series
terminal. You can now sign onto MTS in the usual manner.
d) TEKEMUL at this point in time is emulating a simple "dumb"
terminal; it is not emulating the Tektronix 4010. Thus any
attempt to run a graphics program will yield erroneous results.
The Tektronix emulation phase is initiated by pressing F9 on
the keyboard.
e) Pressing F9 yields another menu which asks you what type of
display monitor(s) you have. Enter "a", "b", or "c". And asks
whether you want to use *IG or *PLOTSEE. Enter "c" or "d". And
finally it prompts you f▀r the object module that will generate
Ü the graphics. You may press the enter key if you are running
*PLOTSEE.
f) The program then switches to the color monitor (if you are
not already on it) and issues the MTS RUN command in the form:
$RUN -LOAD#+*IG
or
$RUN *PLOTSEE
depending on which of the two facilities you selected. When
your graphics program has completed running you will be
returned to MTS.
3. Running More Than One Graphics Program
Once you have been<eke> returned to MTS you can run another
graphics program in one of two ways. You can (a) issue an MTS $RUN
command directly or (b) press F9 once again.
The MTS $RUN command will work directly since you previously
pressed F9. Remember that F9 places you in Tektronix emulation
mode and onto the color monitor. Thus any graphics codes intended
for a Tektronix 4010 will be interpreted and executed by TEKEMUL.
You may also press F9 again to continue having graphical programs
run.
4. Exiting the Emulator and the Color Monitor
Pressing F8 on the keyboard will transfer you back to the
monochrome monitor ( if your system has one ). It will also take
you out of Tektronix emulation mode but will leave you on MTS.
1
5. Exit to DOS
Pressing the F10 function key will cause the program to
transfer control back to the monochrome monitor ( if your system
has one ) and will end the TEKEMUL program, leaving you back in
DOS. It will not explictly sign you off MTS. You must either sign
off yourself or disconnect the line.
6. System Overview
TEKEMUL accepts Tektronix 4010 codes and plots the graphical
information represented by these on the color monitor. Figure 1
illustrates how the system works.
--------------------
| Graphics Program |
MTS | | |
| Tektronix 4010 |
| codes |
--------------------
|
Communication
line
|
------------------------------
| TEKEMUL |
| | | -----------
IBM | ---------------------- | | Color |
PC | | | |----------| Monitor |
| Communication Tektronix | -----------
| Program Code |
| Interpreter |
------------------------------
Figure 1 - System Diagram
To get MTS graphics on the PC color monitor, we have to have
two programs running; one is the graphics program on the MTS side
and the other is TEKEMUL in the PC. The latter allows the user to
connect and sign on to MTS. At this stage no graphics is done yet
and the PC simply acts as a regular terminal with the help of
TEKEMUL. Once signed on the user can run the graphics program on
MTS (such as *IG or *PLOTSEE) that generates the Tektronix 4010
codes.
As MTS sends out the Tektronix 4010 codes, the emulator program
on the IBM PC interprets the information and produces a picture on
the monitor.
1
6.1 General System Information
The information passed to the Tektronix emulation program is
the same as that which would be passed to a Tektronix 4010 series
terminal.
Plotting of graphical information on the IBM PC is done in the
high resolution mode of the BASIC compiler. Thus a color monitor
hooked up to the IBM color monitor adapter must be used.
The resolution of high resolution mode on the IBM PC is 640
horizontal pixels by 200 vertical. Thus TEKEMUL performs a mapping
from the Tektronix coordinate space (1024 x 780) to the IBM PC
coordinate space.
7. TEKEMUL Details
The code for this program has been largely separated into
subroutines and function key and communication trap routines.
Figure 2 shows the program flow.
Define and initialize
global variables
|
Go to subroutine
Set up screen border
|
Print out general
instruction menu
|
Wait for keyboard input
|
Go to subroutine:
clear out body of menu
|
Print out communication
parameter menu
|
Set up communications.
Initialize communications
and F8 F9 and F10 trap routines.
|
|
------>-----------|
| |
| |
| |
------<--------Keyboard input ?
| |
| No | Yes
| |
-------<------- Send input to MTS
Figure 2 - TEKEMUL program flow
1
The program follows the sequence of events outlined in Figure
2. The last loop is one that the program constantly executes when
it has nothing to do: reading input from the keyboard and if any
input exists, transmitting it to the host.
All other functions of the program are accomplished through
trap (interrupt) routines. When a trap routine is finished
executing, control is once again returned to the keyboard reading
loop.
7.1 Subroutine and Trap Routines
There are three trap routines in this program. One of them is
for the communications buffer; the other three for function keys
F8, F9 and F10.
Any information received from the host causes an interrupt
situation and control is passed to the communication trap routine.
The structure diagram for this routine is in Figure 3.
Communication YES
---------------> buffer empty? ----------------> Return
| |
| |
| | NO
| |
| Get a character
| |
| Are we in Tektronix
| emulation mode?
| | |
| | |
| -----<---------------->-------
| | |
| | |
| Go to Tektronix perform ordinary
| simulation terminal functions based
| subroutines on characters received
| | |
| ----->-----------------<------
| |
| |
-----------<------------
Figure 3 - Communication Trap Routine
1
The communication trap routine processes characters received
from MTS one at a time until the IBM PC's communication buffer is
empty. If the program is in Tektronix emulation mode then the
character is passed to the subroutines that actually simulates the
Tektronix 4010.
If the program is not in Tektronix emulation mode then the
character is merely printed on the screen. The routine then
carries on to deal with the next character.
The other three trap routines are executed depending on whether
F8 F9 or F10 is pressed on the keyboard. The F8 trap routine
allows the user to stay signed onto MTS, with the output of the
screen going to the monochrome screen ( if one is attached ). The
advantage is that most people prefer to use the monochrome monitor
for viewing text as opposed to the colour monitor. The F9 trap
routine begins the Tektronix emulation mode, switches the user to
the color monitor and issues various instruction menus. Figure 4
shows the program flow for this routine.
Set up instruction menu
|
Prompt for monitor types
|
| NO
Does user have colour monitor -------->stop
|
YES
|
Prompt for graphics software
to use (*IG or *PLOTSEE)
|
Prompt for user's object module
|
Switch to colour monitor
|
Enable Tektronix emulation mode
|
Send $RUN command to MTS
|
Return
Figure 4 - F9 Trap Routine
1
The F10 trap routine ends Tektronix emulation mode and switches
the user back to the monochrome monitor (if there is one). The
diagram for this routine is in Figure 5.
Disable Tektronix emulation mode
|
Switch to monochrome monitor if
there is one
|
Exit to DOS
Figure 5 - F10 Trap Routine
The subroutines that actually simulate the Tektronix 4010 are
comprised of TEKSIM, ESCAPE-TRUE and ESCAPE-FALSE.
TEKSIM is called from the communications trap routine. Here the
current character from the communications buffer is placed in BYTE
as an ASCII decimal value. If the previous charactor was an escape
character ESCAPE-TRUE is called; else, ESCAPE-FALSE is called.
ESCAPE-TRUE simulates the various functions of the escape
sequences for the Tektronix 4010.
ESCAPE-FALSE checks to see if the current character is a
control character or not. If it is a control character then the
appropriate control function for the Tektronix 4010 is simulated.
Characters other than control characters are decoded into X,Y
coordinates. When a complete (X,Y) address is decoded then a move
or a draw is made to that coordinate address. A draw is
accomplished by using the BASIC subroutine LINE to draw a line on
the screen.
7.2 Global Variables
Global variables important to the simulation part of the
program are described below.
TEKAMUL: a flag indicating whether the program is in Tektronix
emulation mode (TEKEMUL=1) or isn't (TEKEMUL=0).
MODE: indicates if we are in graph mode (MODE=0) or alpha mode
(MODE=1) of the Tektronix 4010 terminal.
DARK: this flag, when set to TRUE, indicates that the next vector
drawn is to be a dark vector. DARK is set to TRUE when a GS
control character is encountered.
1
7.3 Adaptability to other Micros
TEKEMUL has been structured so that it may easily be adapted to
other micro computers. Should the communications facility on
another micro be different than the IBM PC's then one can merely
use the simulator routines TEKSIM, ESCAPE-TRUE, and ESCAPE-FALSE
from the TEKEMUL program.
All that these routines require to function by themselves are
the global variables defined in the start of the program and a
character given to the subroutine TEKSIM.
8. History of the Emulator Program
The original Tektronix emulation project began with a desire to
preview an MTS graphic Plot Description File (PDF) on the IBM PC.
We decided to write a program for the IBM PC which would be much
like *PLOTSEE on MTS, except it would run in the PC. However, we
encountered some practical problems with this scheme. The most
serious of these problems was the amount of time required to plot
a PDF.
This time factor was due to the fact that the PDF had to be
transferred over to the IBM PC in order to be plotted. A PDF can
be on the order of 800,000 bytes. Given this size it was
calculated that many plot files would require several minutes to
be transferred using the file transfer programs.
Another problem complicating the design approach was that Plot
description files are in binary format. The file transfer programs
transfer binary information much slower than character
information.
One solution to this was to represent vector coordinates in a
more compact form. This solution led to the Tektronix 4010 method
of transferring coordinates as efficiently as possible.
We considered converting a plot description file's vector
coordinates into Tektronix format vector coordinates. This much
smaller file could then be transferred over to the IBM PC (as
character data) and then plotted.
But there was no sense writing a conversion program to
translate a PDF into Tektronix format vector coordinates since
Integrated Graphics already has a device driver for the Tektronix
4010 that generated what was needed. It was desirable to eliminate
the file transfer step and have the Tektronix emulator work in
real time as MTS delivered Tektronix 4010 graphics commands.
The regular Tektronix 4010 device driver can be used on MTS,
and, it would be easy for the user to operate. In fact the IBM PC
would operate just like a Tektronix 4010 from a logical point of
view.
1
to operate. In fact the IBM PC
would operate just like a Tektronix 4010 from a logical point